﻿
function main() {
    showLog("抖音(推荐点赞)");
    var testVersion = "(201901021555)版";
    var softwareName = "抖音";
    var view = RequestEngine.getWebView();
    var viewJson = JSON.parse(view);
    var search = viewJson.search;
    var terminationNum = viewJson.terminationNum;
    var shutdwon=0;
    AccessibilityEngine.sleepEngine(5000);//等待
    // chuSiHua(widget.pages.shouye.bugengxin);
    // AccessibilityEngine.sleepEngine(2000);//等待
    if (AccessibilityEngine.checkUpId(widget.pages.shouye.bugengxin) == ISTRUE) { //更新以后再说
        AccessibilityEngine.mockOnClickId(widget.pages.shouye.bugengxin);
    }
    if (AccessibilityEngine.checkUpId(widget.pages.shouye.wzdl) == ISTRUE) { //我知道了
        AccessibilityEngine.mockOnClickId(widget.pages.shouye.wzdl);
    }
    var jixing = getXYByIdIndex(widget.pages.shouye.wode);
    ScreenEngine.swipe(parseX(300), parseY(1000), parseX(300), parseY(200), 500); //从下往上滑动
    if (AccessibilityEngine.checkUpId(widget.pages.shouye.bugengxin) == ISTRUE) { //更新以后再说
        AccessibilityEngine.mockOnClickId(widget.pages.shouye.bugengxin);
    }
    for (var i =0 ; i <search; i ++ ){  // 循环滑动
		if (AccessibilityEngine.checkUpId(widget.pages.shouye.bugengxin) == ISTRUE) { //更新以后再说
			AccessibilityEngine.mockOnClickId(widget.pages.shouye.bugengxin);
		}
		dianZan();
        AccessibilityEngine.sleepEngine(1000);
        ScreenEngine.swipe(parseX(300), parseY(1000), parseX(300), parseY(200), 500); //从下往上滑动
    }
    showLog("显示执行成功");
    setTaskState("5", "脚本执行完毕");
    throw SyntaxError();
	
	 function dianZan() {//701
        AccessibilityEngine.sleepEngine(1000);//等待
        var pressDianZan = "press," + parseX(250) + "," + parseY(350);
        ScreenEngine.currency(pressDianZan);
        AccessibilityEngine.sleepEngine(50);
        ScreenEngine.currency(pressDianZan);
        AccessibilityEngine.sleepEngine(50);
        ScreenEngine.currency(pressDianZan);
        AccessibilityEngine.sleepEngine(50);
        ScreenEngine.currency(pressDianZan);
        AccessibilityEngine.sleepEngine(50);
        ScreenEngine.currency(pressDianZan);
        AccessibilityEngine.sleepEngine(50);
        ScreenEngine.currency(pressDianZan);
        AccessibilityEngine.sleepEngine(1000);//等待
    }
}

var publicfunction = RequestEngine.getPluginPath() + "OS_DYCOMMON/publicfunction.js";
include(publicfunction); //公共方法js
var widgetPath = dyConditionCheck();
var widgetbyid = RequestEngine.getPluginPath() +"OS_DYCOMMON/"+ widgetPath;
include(widgetbyid);
main();
